package metrics

import (
	"gitee.com/captials-team/ubdframe/src/domain/configstc"
	v1log "gitee.com/captials-team/ubdframe/src/pkg/logs"
	"github.com/prometheus/client_golang/prometheus"
)

// IIndicator 指标器接口
type IIndicator interface {
	Report(data IndicData) //上报数据
}

// IPrometheusIndicator prometheus的支持
type IPrometheusIndicator interface {
	Registry() *prometheus.Registry
}

func NewIndicator(conf configstc.MonitorReportConfig, logger v1log.ILog) IIndicator {
	var indicator IIndicator

	switch conf.Platform {
	case "prometheus":
		indicator = NewPrometheusIndicator(conf, logger)
	case "prometheus_push":
		indicator = NewPrometheusPushIndicator(conf, logger)
	case "log":
		indicator = NewLogIndicator(logger)
	default:
		indicator = NewLogIndicator(logger, "UnKnow")
	}
	return indicator
}
